CREATE TABLE [dbo].[App_articulo]
(
[id_articulo] [dbo].[_codigo] NOT NULL,
[codigo] [dbo].[_codigo] NULL,
[descripcion] [dbo].[_nombre] NULL,
[id_entidad] [dbo].[_codigo] NULL,
[marca] [dbo].[_nombre] NULL,
[id_rubro] [dbo].[_codigo] NULL,
[id_categ_art] [dbo].[_codigo] NULL,
[unid_venta] [dbo].[_codigo] NULL,
[unid_empaque] [dbo].[_codigo] NULL,
[medida_empaque] [dbo].[_codigo] NULL,
[precio] [dbo].[_importe] NULL,
[iva1] [dbo].[_importe] NULL,
[iva2] [dbo].[_importe] NULL,
[observaciones] [dbo].[_descripcion] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[App_articulo] ADD CONSTRAINT [PK_articulo] PRIMARY KEY CLUSTERED  ([id_articulo]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[App_articulo] ADD CONSTRAINT [FK_articulo_categ_art] FOREIGN KEY ([id_categ_art]) REFERENCES [dbo].[App_categ_art] ([id_categ_art])
GO
ALTER TABLE [dbo].[App_articulo] ADD CONSTRAINT [FK_articulo_entidad] FOREIGN KEY ([id_entidad]) REFERENCES [dbo].[App_entidad] ([id_entidad])
GO
ALTER TABLE [dbo].[App_articulo] ADD CONSTRAINT [FK_articulo_rubro] FOREIGN KEY ([id_rubro]) REFERENCES [dbo].[App_rubro] ([id_rubro])
GO
EXEC sp_bindefault N'[dbo].[cero]', N'[dbo].[App_articulo].[precio]'
GO
EXEC sp_bindefault N'[dbo].[cero]', N'[dbo].[App_articulo].[iva1]'
GO
EXEC sp_bindefault N'[dbo].[cero]', N'[dbo].[App_articulo].[iva2]'
GO
EXEC sp_addextendedproperty N'MS_Description', N'(proveedor)', 'SCHEMA', N'dbo', 'TABLE', N'App_articulo', 'COLUMN', N'id_entidad'
GO
EXEC sp_addextendedproperty N'MS_Description', N'(21%)', 'SCHEMA', N'dbo', 'TABLE', N'App_articulo', 'COLUMN', N'iva1'
GO
EXEC sp_addextendedproperty N'MS_Description', N'(10.5%)', 'SCHEMA', N'dbo', 'TABLE', N'App_articulo', 'COLUMN', N'iva2'
GO
